package com.kingland.zf.controller;

import com.kingland.zf.model.UserModel;
import com.kingland.zf.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserContorller {
    private UserService userService;

    public  UserContorller(UserService userService){
        this.userService=userService;
    }

    @PostMapping("/user")
    public UserModel addUser(@RequestBody UserModel userModel) {
        this.userService.addUser ( userModel );
        return userModel;
    }

}
